package com.warrior.superdata.controller;

import com.warrior.superdata.base.CommonResponse;
import com.warrior.superdata.base.CommonResult;
import com.warrior.superdata.enums.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiSort;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description:
 * @ClassName: ApiEnumController.java
 * @date: 2022/3/10 10:58
 * @author xujian
 */
@ApiSort(value = 1)
@Api(tags = "api枚举接口")
@RestController
@RequestMapping("/api/enum/")
public class ApiEnumController {

    @ApiOperation(position = 1, value = "数据源类型")
    @GetMapping("/datasource")
    public CommonResult getDatasourceTypeList() {
        return CommonResponse.success(DatasourceType.getList());
    }

    @ApiOperation(position = 2, value = "条件类型")
    @GetMapping("/condition")
    public CommonResult getConditionTypeList() {
        return CommonResponse.success(ConditionType.getList());
    }

    @ApiOperation(position = 3, value = "关系类型")
    @GetMapping("/relation")
    public CommonResult getRelationTypeList() {
        return CommonResponse.success(RelationType.getList());
    }

    @ApiOperation(position = 4, value = "返回数据类型")
    @GetMapping("/result-type")
    public CommonResult getResutTypeList() {
        return CommonResponse.success(ResutType.getList());
    }

    @ApiOperation(position = 5, value = "接口类型")
    @GetMapping("/operate-type")
    public CommonResult getOperateTypeList() {
        return CommonResponse.success(OperateType.getList());
    }


}
